package com.freejava.myblog.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import javax.validation.constraints.NotNull;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(collection = "my_user")
public class MyUser {
    // 用户ID
    @Id
    private int id;
    // 名称
    @Field
    @NotNull(message = "名称能为空")
        private String name;
    // 密码
    @Field
    @NotNull(message = "密码不能为空")
    private String password;
    // 邮箱地址
    @Field
    @NotNull(message = "邮箱地址不能为空")
    private String email;
    // 角色ID
    @Field
    private int roleId;
    // 状态 1: 正常 2: 已封号
    @Field
    private String status;
    // 注册时间
    @Field
    private int regTime;
}
